Skip to content

feat!: store ID mapping into .icpdata/{env}.ids.json#188

Merged
lwshang merged 5 commits intomainfrom
lwshang/SDK-2314_save_canister_id_mapping
Nov 6, 2025
Merged

feat!: store ID mapping into .icpdata/{env}.ids.json#188
lwshang merged 5 commits intomainfrom
lwshang/SDK-2314_save_canister_id_mapping

Conversation

@lwshang
Copy link
Contributor

@lwshang lwshang commented Nov 5, 2025

SDK-2314

Each environment now has a separate file which stores its canister ID mappings (canister name -> canister ID).

The file locates at .icpdata/{env}.ids.json by default.

For example, after creating canister "my-canister" to an environment named "my-environment", the file .icpdata/my-environment.ids.json will be created with following content:

{
  "my-canister": "tqzl2-p7777-77776-aaaaa-cai"
}

Users are encouraged to commit such generated files to VCS so that the created canister IDs won't get lost.
Therefore, they are stored in a different directory other than .icp which is normally ignored.

Test

The ID mappings file is asserted to be existed at the end of canister_create test in canister_create_tests.rs.

@lwshang lwshang marked this pull request as ready for review November 5, 2025 01:04
@lwshang lwshang requested a review from a team as a code owner November 5, 2025 01:04
@lwshang lwshang merged commit bdc716f into main Nov 6, 2025
43 checks passed
@lwshang lwshang deleted the lwshang/SDK-2314_save_canister_id_mapping branch November 6, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants